package 文件输入输出;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.*;

public class FileWithDataOutputStreamTest {
    public static void main(String[] args) {
        File file = new File("src//com//d0320//data.txt");
        FileOutputStream fos = null;
        DataOutputStream dos = null;
        try {
            fos = new FileOutputStream(file);
            dos = new DataOutputStream(fos);
            dos.write(100);
        } catch (FileNotFoundException e) {
            e.printStackTrace();
        } catch (IOException e) {
            e.printStackTrace();
        } finally{
            if(fos != null) {
                try {
                    fos.close();
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
        }
    }
}
